const getKeyByCode = function(code, deep = false) {
	let result = ''
	switch (code.length) {
		case 3:
			result = 'QBM'
			break
		case 6:
			!deep ? result = 'QBM' : result = 'JBM'
			break
		case 9:
			!deep ? result = 'JBM' : result = 'SQBM'
			break
		case 12:
			!deep ? result = 'SQBM' : result = 'WGBM'
			break
		case 15:
			result = 'WGBM'
			break
		default:
			break
	}
	return result
}

const getNameByCode = function(code, deep = false) {
	let result = ''
	switch (code.length) {
		case 3:
			result = 'SSQ'
			break
		case 6:
			!deep ? result = 'SSQ' : result = 'SSJ'
			break
		case 9:
			!deep ? result = 'SSJ' : result = 'SSSQ'
			break
		case 12:
			!deep ? result = 'SSSQ' : result = 'WGQC'
			break
		case 15:
			result = 'WGQC'
			break
		default:
			break
	}
	return result
}

const getUrlByCode = function(code, deep = false) {
	let result = ''
	switch (code.length) {
		case 3:
			result = 'qu_url'
			break
		case 6:
			!deep ? result = 'qu_url' : result = 'jd_url'
			break
		case 9:
			!deep ? result = 'jd_url' : result = 'sq_url'
			break
		case 12:
			!deep ? result = 'sq_url' : result = 'wg_url'
			break
		case 15:
			result = 'wg_url'
			break
		default:
			break
	}
	return result
}

const getLevelByCode = function(code) {
	let result = 0
	switch (code.length) {
		case 3:
			result = 0
			break
		case 6:
			result = 1
			break
		case 9:
			result = 2
			break
		case 12:
			result = 3
			break
		case 15:
			result = 4
			break
		default:
			break
	}
	return result
}

export default {
	getKeyByCode,
	getNameByCode,
	getUrlByCode,
	getLevelByCode
}